package com.atgm.mall.gmmailware.service;

import com.atgm.common.to.OrderTo;
import com.atgm.common.to.SkuHasStockVo;
import com.atgm.mall.gmmailware.vo.WareSkuLockVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atgm.common.utils.PageUtils;
import com.atgm.mall.gmmailware.entity.WareSkuEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author pdx
 * @email 945097967@qq.com
 * @date 2021-08-20 10:09:39
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<SkuHasStockVo> getSkusHasStock(List<Long> skuIds);

    boolean orderLockStock(WareSkuLockVo vo);

    @Transactional
    void unlockStock(OrderTo orderTo);
}

